<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN"
                "http://www.w3.org/TR/REC-html40/loose.dtd">
<html>
<head>
  <title>Description of demhint</title>
  <meta name="keywords" content="demhint">
  <meta name="description" content="DEMHINT Demonstration of Hinton diagram for 2-layer feed-forward network.">
  <meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1">
  <meta name="generator" content="m2html &copy; 2003 Guillaume Flandin">
  <meta name="robots" content="index, follow">
  <link type="text/css" rel="stylesheet" href="../../m2html.css">
</head>
<body>
<a name="_top"></a>
<div><a href="../../menu.html">Home</a> &gt;  <a href="#">ReBEL-0.2.7</a> &gt; <a href="#">netlab</a> &gt; demhint.m</div>

<!--<table width="100%"><tr><td align="left"><a href="../../menu.html"><img alt="<" border="0" src="../../left.png">&nbsp;Master index</a></td>
<td align="right"><a href="menu.html">Index for .\ReBEL-0.2.7\netlab&nbsp;<img alt=">" border="0" src="../../right.png"></a></td></tr></table>-->

<h1>demhint
</h1>

<h2><a name="_name"></a>PURPOSE <a href="#_top"><img alt="^" border="0" src="../../up.png"></a></h2>
<div class="box"><strong>DEMHINT Demonstration of Hinton diagram for 2-layer feed-forward network.</strong></div>

<h2><a name="_synopsis"></a>SYNOPSIS <a href="#_top"><img alt="^" border="0" src="../../up.png"></a></h2>
<div class="box"><strong>function demhint(nin, nhidden, nout) </strong></div>

<h2><a name="_description"></a>DESCRIPTION <a href="#_top"><img alt="^" border="0" src="../../up.png"></a></h2>
<div class="fragment"><pre class="comment">DEMHINT Demonstration of Hinton diagram for 2-layer feed-forward network.

    Description

    DEMHINT plots a Hinton diagram for a 2-layer feedforward network with
    5 inputs, 4 hidden units and 3 outputs. The weight vector is chosen
    from a Gaussian distribution as described under MLP.

    DEMHINT(NIN, NHIDDEN, NOUT) allows the user to specify the number of
    inputs, hidden units and outputs.

    See also
    <a href="hinton.html" class="code" title="function h = hinton(w);">HINTON</a>, <a href="hintmat.html" class="code" title="function [xvals, yvals, color] = hintmat(w);">HINTMAT</a>, <a href="mlp.html" class="code" title="function net = mlp(nin, nhidden, nout, outfunc, prior, beta)">MLP</a>, <a href="mlppak.html" class="code" title="function w = mlppak(net)">MLPPAK</a>, <a href="mlpunpak.html" class="code" title="function net = mlpunpak(net, w)">MLPUNPAK</a></pre></div>

<!-- crossreference -->
<h2><a name="_cross"></a>CROSS-REFERENCE INFORMATION <a href="#_top"><img alt="^" border="0" src="../../up.png"></a></h2>
This function calls:
<ul style="list-style-image:url(../../matlabicon.gif)">
<li><a href="mlp.html" class="code" title="function net = mlp(nin, nhidden, nout, outfunc, prior, beta)">mlp</a>	MLP	Create a 2-layer feedforward network.</li><li><a href="mlphint.html" class="code" title="function [h1, h2] = mlphint(net);">mlphint</a>	MLPHINT Plot Hinton diagram for 2-layer feed-forward network.</li></ul>
This function is called by:
<ul style="list-style-image:url(../../matlabicon.gif)">
<li><a href="demnlab.html" class="code" title="function demnlab(action);">demnlab</a>	DEMNLAB A front-end Graphical User Interface to the demos</li></ul>
<!-- crossreference -->


<h2><a name="_source"></a>SOURCE CODE <a href="#_top"><img alt="^" border="0" src="../../up.png"></a></h2>
<div class="fragment"><pre>0001 <a name="_sub0" href="#_subfunctions" class="code">function demhint(nin, nhidden, nout)</a>
0002 <span class="comment">%DEMHINT Demonstration of Hinton diagram for 2-layer feed-forward network.</span>
0003 <span class="comment">%</span>
0004 <span class="comment">%    Description</span>
0005 <span class="comment">%</span>
0006 <span class="comment">%    DEMHINT plots a Hinton diagram for a 2-layer feedforward network with</span>
0007 <span class="comment">%    5 inputs, 4 hidden units and 3 outputs. The weight vector is chosen</span>
0008 <span class="comment">%    from a Gaussian distribution as described under MLP.</span>
0009 <span class="comment">%</span>
0010 <span class="comment">%    DEMHINT(NIN, NHIDDEN, NOUT) allows the user to specify the number of</span>
0011 <span class="comment">%    inputs, hidden units and outputs.</span>
0012 <span class="comment">%</span>
0013 <span class="comment">%    See also</span>
0014 <span class="comment">%    HINTON, HINTMAT, MLP, MLPPAK, MLPUNPAK</span>
0015 <span class="comment">%</span>
0016 
0017 <span class="comment">%    Copyright (c) Ian T Nabney (1996-2001)</span>
0018 
0019 <span class="keyword">if</span> nargin &lt; 1 nin = 5; <span class="keyword">end</span>
0020 <span class="keyword">if</span> nargin &lt; 2 nhidden = 7; <span class="keyword">end</span>
0021 <span class="keyword">if</span> nargin &lt; 3 nout = 3; <span class="keyword">end</span>
0022 
0023 <span class="comment">% Fix the seed for reproducible results</span>
0024 randn(<span class="string">'state'</span>, 42);
0025 clc
0026 disp(<span class="string">'This demonstration illustrates the plotting of Hinton diagrams'</span>)
0027 disp(<span class="string">'for Multi-Layer Perceptron networks.'</span>)
0028 disp(<span class="string">' '</span>)
0029 disp(<span class="string">'Press any key to continue.'</span>)
0030 pause
0031 net = <a href="mlp.html" class="code" title="function net = mlp(nin, nhidden, nout, outfunc, prior, beta)">mlp</a>(nin, nhidden, nout, <span class="string">'linear'</span>);
0032 
0033 [h1, h2] = <a href="mlphint.html" class="code" title="function [h1, h2] = mlphint(net);">mlphint</a>(net);
0034 clc
0035 disp(<span class="string">'The MLP has been created with'</span>)
0036 disp([<span class="string">'    '</span> int2str(nin) <span class="string">' inputs'</span>])
0037 disp([<span class="string">'    '</span> int2str(nhidden) <span class="string">' hidden units'</span>])
0038 disp([<span class="string">'    '</span> int2str(nout) <span class="string">' outputs'</span>])
0039 disp(<span class="string">' '</span>)
0040 disp(<span class="string">'One figure is produced for each layer of weights.'</span>)
0041 disp(<span class="string">'For each layer the fan-in weights are arranged in rows for each unit.'</span>)
0042 disp(<span class="string">'The bias weight is separated from the rest by a red vertical line.'</span>)
0043 disp(<span class="string">'The area of each box is proportional to the weight value: positive'</span>)
0044 disp(<span class="string">'values are white, and negative are black.'</span>)
0045 disp(<span class="string">' '</span>)
0046 disp(<span class="string">'Press any key to exit.'</span>); 
0047 pause; 
0048 delete(h1);
0049 delete(h2);</pre></div>
<hr><address>Generated on Tue 26-Sep-2006 10:36:21 by <strong><a href="http://www.artefact.tk/software/matlab/m2html/">m2html</a></strong> &copy; 2003</address>
</body>
</html>